Scanner, scan program, and method of producing scan data

ABSTRACT

There is provided a scanner that combines images read by a first sensor array and a second sensor array, in which the first sensor array and the second sensor array have read regions which are overlapped partially, and includes a combining section that combines a straight line as an image of a non-straight line in a case where the straight line which is non-parallel and non-perpendicular in a main scanning direction is read in an overlapped manner by the first sensor array and the second sensor array.

BACKGROUND 1. Technical Field

The present invention relates to a scanner, a scan program, and a methodof producing scan data.

2. Related Art

In the related art, there is a known technique of scanning a documentusing a plurality of line sensors and combining an output detected byeach line sensor to produce scan data. For example, in the techniquesdisclosed in Japanese Patent No. 4864021 and U.S. Pat. No. 8,345,325,the scan data is generated by reading overlap regions using a pluralityof line sensors and combining reading results.

In the related art described above, when the document is displaced froma reference reading position such as floating of the document from adocument platen, images of the regions read by the plurality of linesensors in an overlapped manner may not be combined accurately.

SUMMARY

An advantage of some aspects of the invention is to improve an imagequality of scan data obtained by combining outputs of a plurality ofline sensors.

According to an aspect of the invention, there is provided a scannerthat combines images read by a first sensor array and a second sensorarray, in which the first sensor array and the second sensor array haveread regions which are overlapped partially, and includes a combiningsection that combines a straight line as an image of a non-straight linein a case where the straight line which is non-parallel andnon-perpendicular in a main scanning direction is read in an overlappedmanner by the first sensor array and the second sensor array. In thisconfiguration, it is possible to perform the combining withoutdeterioration of an image quality such as a separation of the straightline although the straight line which is non-parallel andnon-perpendicular in the main scanning direction becomes thenon-straight line. Accordingly, it is possible to improve the imagequality of scan data obtained by combining outputs of a plurality ofline sensors.

In the scanner, in a case where the straight line which is non-paralleland non-perpendicular in the main scanning direction is read andcombined, the image of the non-straight line may have both end portionsand the center portion having an angle closer to the main scanningdirection than angles of the both end portions. In this configuration,it is possible to perform the combining without the deterioration of theimage quality such as the separation of the straight line. Accordingly,it is possible to improve the image quality of the scan data obtained bycombining the outputs of the plurality of line sensors.

In the scanner that combines the images read by the first sensor arrayand the second sensor array, in a case where the first sensor array andthe second sensor array have the read regions which are overlappedpartially and the straight line on the document is read by the firstsensor array and the second sensor array, the scanner may include thecombining section that combines in a first case where the documentexists at a first position and in a second case where the documentexists at a second position distant from the first position as imageshaving the same width. The first position and the second position mayhave a distance in which elements detecting the straight line aredeviated by one or more elements. In this configuration, it is possibleto perform the combining without the deterioration of the image qualitysuch as increase or decrease of the width of the lines. Accordingly, itis possible to improve the image quality of the scan data obtained bycombining the outputs of the plurality of line sensors.

In the scanner that combines the images read by the first sensor arrayand the second sensor array, the scanner may include the combiningsection that combines the straight line as an image of a single line ina case where the first sensor array and the second sensor array have theread regions which are overlapped partially and reading results of thefirst sensor array and the second sensor array are deviated by at leastfour pixels in the main scanning direction, and in a case where thestraight line which is non-parallel and non-perpendicular in the mainscanning direction is read by the first sensor array and the secondsensor array as an image having a width of two pixels in the mainscanning direction. In this configuration, it is possible to perform thecombining without the deterioration of the image quality such as thediscontinuity of the straight line. Accordingly, it is possible toimprove the image quality of the scan data obtained by combining theoutputs of the plurality of line sensors.

In the scanner that combines the images read by the first sensor arrayand the second sensor array, the scanner may include the combiningsection that combines the straight line as an image of a single line ina case where the first sensor array and the second sensor array have theread regions which are overlapped partially and reading results of thefirst sensor array and the second sensor array are deviated by at leastfour pixels in the main scanning direction, and in a case where thestraight line perpendicular to the main scanning direction is read as animage having a width of two pixels in the main scanning direction. Inthis configuration, it is possible to perform the combining without thedeterioration of the image quality such as the separation of thestraight line. Accordingly, it is possible to improve the image qualityof the scan data obtained by combining the outputs of the plurality ofline sensors.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will be described with reference to the accompanyingdrawings, wherein like numbers reference like elements.

FIG. 1 is a block diagram of a scanner.

FIG. 2 is a diagram showing a peripheral structure of a sub scanningapparatus of the scanner.

FIG. 3 is a diagram showing a configuration example of an opticalsection of the scanner.

FIG. 4 is a diagram schematically showing a reduction by the opticalsection.

FIG. 5 is a diagram showing a combining of reading results.

FIG. 6 is an explanatory diagram of an overlap region.

FIG. 7 is an explanatory diagram of a first read image and a second readimage.

FIG. 8 is an explanatory diagram of a mix.

FIG. 9 is an explanatory diagram for describing an influence ofdisplacement of a document.

FIG. 10 is an explanatory diagram of the first read image and the secondread image in a state where displacement from a reference readingposition occurs.

FIG. 11 is an explanatory diagram of the mix in a state where thedisplacement from the reference reading position occurs.

FIG. 12 is an explanatory diagram of deformation.

FIG. 13 is an explanatory diagram for describing an example in which acharacter is deformed.

FIG. 14 is a flowchart of scan processing.

FIG. 15 is a flowchart of deviation amount calculation processing.

FIG. 16 is a diagram showing a movement in the deviation amountcalculation.

FIG. 17 is a diagram showing minimization of a difference after themovement.

FIG. 18 is a flowchart of deformation processing.

FIG. 19 is an explanatory diagram of the deformation.

FIG. 20 is an explanatory diagram of the deformation.

FIG. 21 is a flowchart of correction processing.

FIG. 22 is a diagram showing an example of the document.

FIG. 23 is a diagram showing an example of scan data in a case where thedeformation and the mix are not performed.

FIG. 24 is a diagram showing an example of the scan data in a case wherethe mix is performed.

FIG. 25 is a diagram showing an example of the scan data in a case wherethe deformation and the mix are performed.

FIG. 26 is a diagram showing an example of the scan data in the casewhere the deformation and the mix are performed.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

Here, embodiments of the invention will be described in the followingorder.

(1) Configuration of Scanner (2) Combination of Output (3) ScanProcessing (4) Deviation Amount Calculation Processing (5) DeformationProcessing (6) Correction Processing (7) Example (8) Another Embodiment(1) Configuration of Scanner

FIG. 1 is a block diagram of a scanner 1 according to an embodiment ofthe invention. The scanner 1 includes a controller 10, a communicationsection 70, an operation section 80, and a read section (light source31, sensor 21, sub scanning apparatus 41, and optical section 61). Thecontroller 10 includes a recording medium (not shown) and a processor(may be a dedicated circuit such as an ASIC in which a circuit isconfigured so as to execute specific processing, the ASIC or the likeand a CPU that cooperate with each other, or the CPU) that reads aprogram from the recording medium and executes the program.

The controller 10 includes a combining section 11, an acquisitionsection 12, and a correction section 13, controls each section of thescanner 1, reads a document by processing of the combining section 11,corrects reading results by processing of the acquisition section 12 andthe correction section 13, and generates scan data. The operationsection 80 includes an output section for providing various pieces ofinformation to a user and an input section for accepting an inputoperation by the user. The controller 10 controls the operation section80 to display information for selecting a read condition, instructing ascan start, or the like on the output section. It is possible for theuser to input the selection of the read condition, the instruction ofthe scan start, or the like based on an output of the output section.

When the instruction of the scan start is input, the combining section11 controls each section of the scanner 1 to cause an operation (forexample, transportation of document) for reading the document. With theoperation, when the reading results are output from a line sensor, thecombining section 11 combines the reading results, and the acquisitionsection 12 and the correction section 13 correct the reading results togenerate scan data.

The communication section 70 is an apparatus for communicating with anexternal apparatus (external computer 90 in the embodiment), and thecontroller 10 transmits arbitrary information to the computer 90 and canreceive various instructions or the like from the computer 90. In theembodiment, when the correction section 13 of the controller 10generates the scan data, the correction section 13 transmits the scandata to the computer 90 through the communication section 70. Needlessto say, the scan data may be used in various modes, may be stored in therecording medium (not shown) included in the scanner 1, may be stored ina portable recording medium, and may be provided to an apparatus otherthan the computer 90 through the communication section 70.

The scanner 1 according to the embodiment includes a document platen,and a document placed on the flat document platen is read. Accordingly,in the embodiment, the document is read usually at a position of theupper surface of the document platen (surface on which document isplaced). In the embodiment, the upper surface of the document platen isreferred to as a reference reading position. The document on thedocument platen is read by the read section including a sensor 21, alight source 31, a sub scanning apparatus 41, and an optical section 61.

FIG. 2 is a diagram schematically showing a document platen 50, a readsection U, and a cover 51. In the figure, the X-axis indicates a subscanning direction, the Z-axis indicates a direction perpendicular tothe document platen 50, and a direction perpendicular to the X-axis andthe Z-axis is a main scanning direction. The cover 51 which can beopened and closed by a hinge is attached to the scanner 1. When thecover 51 is closed in a state where there is no document on the documentplaten 50, a white reference plate W, a black reference plate B, and acombining mark plate M provided on the back surface of the cover 51 comeinto contact with the document platen 50. Accordingly, when the cover 51is closed in the state where there is no document on the documentplaten, it is possible to read the white reference plate W, the blackreference plate B, and the combining mark plate M.

The white reference plate W, the black reference plate B, and thecombining mark plate M can be disposed at arbitrary positions within areading range. In the embodiment, the white reference plate W, the blackreference plate B, and the combining mark plate M are disposed atpositions not overlapped with the document. That is, in the embodiment,it is configured such that the document is disposed aligned at one end(X-axis negative direction) of the document platen 50, and when thecover 51 is closed with the document on the document platen 50, it isdisposed at such a position that the document does not come into contactwith the white reference plate W, the black reference plate B, and thecombining mark plate M. For this reason, it is possible to read thewhite reference plate W, the black reference plate B, and the combiningmark plate M as necessary before the reading of the document.

The white reference plate W, the black reference plate B, and thecombining mark plate M are members long in the main scanning directionand exist at least over the entire reading range in the main scanningdirection. The combining mark plate M is a member in which combiningmark is formed in each of overlap regions (details will be describedbelow) read by a plurality of line sensors in an overlapped manner. Thecombining mark is a mark for specifying a binding position which is thereference for combining read image read by each line sensor. When eachline sensor read the combining mark in a state where the cover 51 isclosed, it is configured such that a binding is performed by overlappingpixels of elements that read the combining mark. The white referenceplate W is a white member which is a reference for white, and a surfacein contact with the document platen 50 is a white reference surfacewhich is a white reference. The black reference plate B is a blackmember which is a reference for black, and a surface in contact with thedocument platen 50 is a black reference surface which is a blackreference.

The sub scanning apparatus 41 is an apparatus capable of reciprocatingthe read section U in the sub scanning direction (X-axis direction). Thecontroller 10 can control an operation of the sub scanning apparatus 41by the processing of the combining section 11.

The light source 31 includes an LED attached to the sub scanningapparatus 41 so as to irradiate illumination light toward apredetermined direction of the document platen. Accordingly, in a casewhere the document is read, the light source 31 can move in the subscanning direction in a state where an orientation of the LED faces afixed direction. That is, a position irradiated by the illuminationlight moves in the sub scanning direction to change a reading position,and a sub scanning is performed. The light source 31 may include the LEDhaving one color or may include the LEDs having a plurality of colors.That is, in a case where color scan is performed, reading of each colormay be performed in a state where one color of the LEDs having theplurality of colors (typically three colors) is turned on and othercolors are turned off. In the case, processing of the combining or thelike described later may be performed for each color or a calculationmay be performed for the combining based on a representative colorcomponent (for example, image having brightness calculated fromarbitrary one color or the plurality of colors of LEDs) and thecombining of each color may be performed based on the calculationresult.

The optical section 61 includes an optical member that forms an image ofthe document while reducing the image in the sensor 21. That is, theoptical section 61 includes the optical member that forms an opticalpath for guiding light from the document generated by irradiating thedocument with light from the light source 31 is guided to the linesensor. The optical path may be provided by various structures, and theoptical member can be configured by any of various members such as adiaphragm, a lens, or reflection mirror or a combination thereof.

FIG. 3 is a diagram showing an example of the optical path and shows astate where the line of sight is parallel to the main scanningdirection. FIG. 3 shows the light source 31 for irradiating a document Pplaced on the document platen 50 with light, the optical section 61 (61a and 61 b), and the sensor 21. The optical section 61 includes tworeflection mirrors 61 a and 61 b, and, for example, when the reflectionmirror 61 a is a plane mirror and the reflection mirror 61 b is aconcave mirror, it is possible to employ a configuration of guidinglight of one line in the main scanning direction (directionperpendicular to the X-axis and the Z-axis) of the document P to a linesensor 21 a by dividing and reducing the light in the main scanningdirection or the like.

Light reflected by an object (for example, document or white referenceplate) existing at the reference reading position is received by aplurality of line sensors 21 a included in the sensor 21. Each the linesensor 21 a is a sensor extending in one direction and is a sensor inwhich a plurality of photoelectric conversion elements (hereinafter,referred to as elements) are arranged in the one direction. Each linesensor 21 a is arranged in the main scanning direction such that adirection in which the elements are aligned becomes a linear form.

The sensor 21 includes an analog front-end (not shown). The analogfront-end includes a circuit that acts a gain on a signal output fromthe element according to an amount of received light and outputs thesignal, and a circuit that performs an A/D conversion. In theembodiment, the analog front-end includes a recording medium thatrecords information indicating the gain, and in the analog front-end, again adjustment is performed to set a black level of the sensor 21 to aminimum output value and a white level to a maximum output value basedon the information indicating the gain.

FIG. 4 schematically shows an action by the optical section 61 in astate where the line of sight is parallel to the sub scanning direction.In FIG. 4, it is shown that light from the document P is guided to theline sensor 21 a through the optical section 61, and a optical path ofthe light from the document P is shown schematically by a broken lineand a dashed-dotted line. That is, the line sensors 21 a are arranged inthe main scanning direction (Y-axis direction), and an image for eachpart which is overlapped partially and is adjacent to each other in themain scanning direction on the document P is reduced in each part of theoptical section 61 corresponding to each part of the document P. Theimage in each part of the document P is formed in each line sensor 21 acorresponding to each part. In FIG. 4, the broken line and thedashed-dotted line schematically show a range of the optical path, andthe image can be reversed in the Y direction by optical section 61.

As described above, in each line sensor 21 a included in the sensor 21in the embodiment, it is configured such that adjacent each line sensor21 a read each part adjacent in the main scanning direction on thedocument P and the adjacent line sensor 21 a reads an overlap regionwhich is the same region on the document P in an overlapped manner in apart of the sensor. Accordingly, in a case where a region on thedocument read by one adjacent line sensor 21 a is a first region, aregion on the document read by the other adjacent line sensor 21 a is asecond region. A region in which the first region and the second regionare overlapped is the overlap region. In FIG. 4, one example of a firstregion R1, a second region R2, and an overlap region Rc is shown.However, when 16 line sensors 21 a exist as shown in FIG. 4, 15 overlapregions exist, and when 18 line sensors 21 a exist, 17 overlap regionsexist.

(2) Combining of Output

In each line sensor 21 a, since the overlap region of the document P isread in an overlapped manner, the combining section 11 of the controller10 combines data output by the adjacent line sensor 21 a. Specifically,the combining section 11 mixes the outputs of the plurality of linesensors 21 a based on the combining mark formed on the combining markplate M. For this purpose, in the embodiment, the reading of thecombining mark is performed before the reading of the document P.

Specifically, the combining section 11 controls the sub scanningapparatus 41 to move the read section to a position where the combiningmark can be read. In the state, the combining section 11 turns on thelight source 31. As a result, each line sensor 21 a outputs an imagethat reads the combining mark. FIG. 5 is a schematic diagram showing theelements included in the line sensor 21 a, and the elements areindicated by circles. In an example shown in FIG. 5, the combining markis a straight line extending in the sub scanning direction, and a partother than the combining mark on a combining mark surface is white.

The combining mark is read by both adjacent line sensors 21 a. In FIG.5, the elements of the line sensors 21 a that read the combining markformed at the same position of the combining mark plate M are colored inblack and are shown schematically, and the combining mark is shownschematically by hatching and is overlapped on the elements that readthe combining mark. The schematic diagram of the line sensor 21 a isdisposed such that the elements that read the combining mark arearranged in the vertical direction by disposing one adjacent line sensor21 a on the upper left side and disposing the other line sensor on thelower right side. Here, the one adjacent line sensor 21 a is referred toas a first line sensor 21 a 1, and the other line sensor is referred toas a second line sensor 21 a 2.

The first line sensor 21 a 1 and the second line sensor 21 a 2 output anoutput according to the amount of received light of each elementarranged in the main scanning direction as serial data. The combiningsection 11 analyzes an output of the first line sensor 21 a 1 to specifythat the sixth element S₆₁ from the end portion detects the combiningmark. The combining section 11 analyzes an output of the second linesensor 21 a 2 to specify that the sixth element S₆₂ from the end portiondetects the combining mark. In the case, the combining section 11records a position of each element in association with each line sensor21 a in a memory (not shown) by assuming that the sixth element S₆₁ fromthe end portion of the first line sensor 21 a 1 and the sixth elementS62 from the end portion of the second line sensor 21 a 2 read the sameposition. Here, a position of elements that read the same position isreferred to as the binding position.

The combining section 11 sequentially performs the above processing froma line sensor 21 a located at the end in the main scanning direction tospecify the binding position of each of the plurality of line sensors 21a. With the specified binding position as described above, when thedocument P is read, the combining section 11 mixes the output of eachline sensor 21 a based on the position to generate data of one line. Inthe embodiment, the mixing is performed by adding a value obtained byweighting the output of the adjacent line sensor 21 a.

That is, when a first read image generated from the output of the firstline sensor 21 a 1 and a second read image generated from the output ofthe second line sensor 21 a 2 are combined, if one pixel of a firstrange is generated by only the first read image and the other pixel of asecond range is generated by only the second read image with the bindingposition as the boundary, the image quality is deteriorated. Forexample, the image is viewed discontinuously with the binding positionwhich is the seam as the boundary, so that the image quality may bedeteriorated such as the seam being recognized. In the embodiment, thecombining is performed from the first range toward the second range bygradually changing the weight of the first read image from a large valueto a small value and by gradually changing the weight of the second readimage from a small value to a large value. Specifically, positions ofpixels of the first read image and the second read image are expressedas E_(i,1) and E_(i,2) at position i (i is an integer of 1 or more) fromthe end of one line sensor, and pixels at the binding position of eachline sensor are expressed as the same position number (i=6 in theexample shown in FIG. 5). For example, a position of the end of thesecond line sensor 21 a 2 shown in FIG. 5 is i=1, and a position of theend of the first line sensor 21 a 1 is i=11.

In the case, a value of an image after the combining at the position iis a_(i)E_(i.1)+biE_(i,2). Also, a_(i) and b_(i) are weighting values,1=a_(i)+b_(i). In the example, a_(i) has an initial value of 1 anddecreases to zero with increasing i, and b_(i) has an initial value ofzero and increases to 1 with increasing i. Further, in the embodiment,weights a₆ and b₆ at the binding position i=6 are set to be equal. Thatis, the mixing ratio at the binding position is 50%, the weighting ofthe second read image becomes large in the second range on the secondline sensor 21 a 2 side than the binding position, and the weighting ofthe first read image becomes large in the first range on the first linesensor 21 a 1 side than the binding position.

According to the configuration in which the combining is performed bythe mixing as described above, it is possible to perform the combiningsuch that the seam is inconspicuous. The weighting value may be changedgradually from the first range toward the second range, may be changedcontinuously, or step by step. The weighting may be changed linearly orcurvilinearly along the main scanning direction.

In the scanner 1, the sub scanning apparatus 41 moves the sensor 21 orthe like in the sub scanning direction to perform the sub scanning. As aresult, it is possible to scan the document two-dimensionally. FIGS. 6to 8 are explanatory diagrams for two-dimensionally describing thecombining performed based on the output of the adjacent line sensor 21a. FIG. 6 shows a character example “MNO” on a document read by certainfirst line sensor 21 a 1 and second line sensor 21 a 2. The exampleshows that “MN” is written in the first region R₁, and “NO” is writtenin the second region R₂. In the example, “N” is written in the overlapregion Rc.

FIG. 7 shows an example of a first read image I₁ and a second read image12 in a case where the first line sensor 21 a 1 and the second linesensor 21 a 2 read the document shown in FIG. 6. As shown in the figure,the character in the overlap region Rc is read by both the first linesensor 21 a 1 and the second line sensor 21 a 2, and the charactersoutside the overlap region Rc are read by either the first line sensor21 a 1 or the second line sensor 21 a 2.

In FIG. 7, a binding position Pb of the first read image I₁ and thesecond read image I₂ is indicated by an arrow. In the example shown inFIG. 7, since the center of the character “N” is the binding positionPb, left and right images of the binding position Pb are mixed to becombined. That is, an image in a region Z_(1L) and an image in a regionZ_(2L) shown in FIG. 7 are mixed by the weighting which is changed foreach position. An image in a region Z_(1R) and an image in a regionZ_(2R) shown in FIG. 7 are mixed by the weighting which is changed foreach position.

FIG. 8 is a diagram showing an image after the combining by the mixing.In FIG. 8, “aZ_(1L)+bZ_(2L)” indicates that the half of the left side ofthe character “N” is a weighted addition of the image in the regionZ_(1L) and the image in the region Z_(2L), and “aZ_(1R)+bZ_(2R)”indicates that the half of the right side of the character “N” is theweighted addition of the image in the region Z_(1R) and the image in theregion Z_(2R).

According to the configuration described above, in a case where areading surface of the document is in contact with the upper surface ofthe document platen 50 and the reading surface of the document exists atthe reference reading position, it is possible to appropriately generatethe image of one line in the main scanning direction by the plurality ofline sensors and appropriately generate the sub scanned two-dimensionalimage. However, a user of the scanner 1 according to the embodiment cancause the reading of the document in various modes, and the reading maybe performed in a state where the document is displaced from thereference reading position. For example, in a case where the reading ofa book bound by a spine cover is performed, since a state where all thedocuments near a bound portion are in contact with the document platen50 cannot be realized, the reading may be performed in a state where atleast a part of the document is floated.

In the scanner 1, since the light from the document is guided to theline sensor 21 a through the optical section 61, when the reading isperformed in the state where the document is displaced from thereference reading position, the reading results of the same document aredifferent due to the variation of the optical path of the light reachingthe line sensor 21 a as compared with a state where the document is notdisplaced from the reference reading position. Specifically, in theembodiment, when the document position is displaced from the referencereading position and the floating occurs, an optical path length in acase of performing the reading in the state becomes longer than areference optical path length.

FIG. 9 is an enlarged diagram showing a part extracted from the opticalsection 61 and the document shown in FIG. 4. In FIG. 9, the thick brokenline or the thick dashed-dotted line indicates the range of the opticalpath. In a case where the document existing at a reference readingposition P₁ is read, a region in which the first region R₁ and thesecond region R₂ shown in FIG. 9 are overlapped is the overlap regionRc. On the other hand, in a case where the same document shifts to theZ-axis positive direction and exists at a position P₂, the first linesensor 21 a 1 reads the first region R₁₂, and the second line sensor 21a 2 reads the second region R₂₂. Accordingly, in the case, the overlapregion is Rc2.

As described above, when the document is displaced from the referencereading position (floating occurs), the range read by the first linesensor 21 a 1 and the second line sensor 21 a 2 becomes wide due to theincrease of the optical path length. For example, in a case where thedocument as shown in FIG. 6 exists at the position P₂, the first regionR₁₂ becomes wider than the first region R₁, the second region R₂₂becomes wider than the second region R₂, and the overlap region Rc2becomes wider than the overlap region Rc.

Since the number and size of the first line sensor 21 a 1 and the secondline sensor 21 a 2 are not changed, when a wider range is read than inthe case where the document exists at appropriate reference readingposition, the first read image and the second read image which are thereading results of the first line sensor 21 a 1 and the second linesensor 21 a 2 are in a reduced state as compared with the case where thedocument existing at the reference reading position P1 is read.

FIG. 10 shows an example of the first read image In and the second readimage 122 in a case where the first region R.₁₂ and the second regionR₂₂ shown in FIG. 6 are read. That is, in the example shown in FIG. 10,images are reduced than the reading results in the case where thedisplacement does not occur, and a part of other characters “O” and “M”is included in the region Z_(1L), the region Z_(1R), the region Z_(2L),and the region Z_(2R) in which only the character “N” is read in thecase where the displacement does not occur. In the state where suchreduction occurs, even in a case where the combining is performed at thesame binding position as in the case where the displacement does notoccur, the image in the region Z_(1L) and the image in the region Z_(2L)shown in FIG. 10 are mixed by the weighting which is changed for eachposition as long as the mixing is performed based on the bindingposition. The image in the region Z_(1R) and the image in the regionZ_(2R) shown in FIG. 10 are mixed by the weighting which is changed foreach position.

Since the image at the binding position Pb passes the optical pathindicated by the thin broken line or the dashed-dotted line in FIG. 9,in a case where the document exists at the reference reading positionP₁, an image indicating the reading results at the same position isobtained. However, in a case where the document does not exist at thereference reading position P₁, an image indicating the reading resultsat the same position is not obtained. In the example shown in FIG. 10,different portions of the oblique line of the character “N” are cut bythe binding position Pb in the first read image I₁₂ and the second readimage I₂₂. Accordingly, even when the images at the binding position Pbare overlapped, the images are not bound appropriately.

FIG. 11 is a diagram showing an image after the combining of the readingresults shown in FIG. 10 by the mixing. As shown in the example, sincethe image in the region Z_(1L) and the image in the region Z_(2L) shownin FIG. 10 deviate significantly, even when the weighted addition(aZ_(1L)+bZ_(2L)) is performed based on the images in the regions, thedeviation cannot be eliminated, and the image based on the first readimage I₁₂ appears dark and the image based on the second read image I₂₂appears thin.

Since the image in the region Z_(IR) and the image in the region Z_(2R)shown in FIG. 10 deviate significantly, even when the weighted addition(aZ_(1R)+bZ_(2R)) is performed based on the images in the regions, thedeviation cannot be eliminated, and the image based on the first readimage I₁₂ appears thin and the image based on the second read image I₂₂appears dark. Further, the oblique line of N is separated into differentstraight lines at the binding position Pb. That is, when the combiningis performed without considering the variation of the document positionfrom the reference reading position, the image quality may bedeteriorated such as the straight line (oblique line portion ofcharacter “N”) which is non-parallel and non-perpendicular in the mainscanning direction on the overlap region is separated into two differentstraight lines.

In the embodiment, the combining section 11 deforms the images in theoverlap region in the main scanning direction before the mixing. FIG. 12is a diagram for describing a deformation in the main scanningdirection. In FIG. 12, an example of the first read image is indicatedby a solid line, and an example of the second read image is indicated bya dashed-dotted line. The horizontal axis is a position of a pixel, andthe vertical axis is density (value according to detection intensity ofeach element). In the example, the position i=6 is the binding positionPb. Since each image is density information at each position of thepixels, the density has a discrete value for each position, but adensity change is indicated by a line to facilitate understanding of thedeformation in FIG. 12. That is, the density between positions of thepixels is estimated to change continuously, and the density betweenpositions of the pixels can be obtained by, for example, aninterpolation calculation such as cubic interpolation.

In FIG. 12, it is assumed that the density changes abruptly from acertain value V₂ to another certain value V₁ in the front/rear of thebinding position i=6, and a figure in which the density is Vm at thebinding position i=6 is formed in the overlap region. Accordingly, inthe case where the document is read in the state where the document isnot displaced from the reference reading position, it is expectedideally that the density at the binding position i=6 is Vm and thedensity in the front/rear of the position is changed abruptly.

In the first read image and the second read image shown in FIG. 12, thedensity at the position i=6 is not Vm, and regions where the density ischanged abruptly also deviate. That is, in a case where the reading withthe reduction as shown in FIG. 10 occurs, each portion of a regularimage is reduced so as to move from the end portion of the image to acenter portion in each read image. For example, in the first read imageshown in FIG. 12, the abrupt change region of the density deviates tothe left side of the graph (region side in which value at position i issmall). In the second read image, the abrupt change region of thedensity deviates to the right side of a graph (region side in whichvalue at position i is large).

In the embodiment, the combining section 11 enlarges the image from thecenter portion of the image to the end portion side to perform thedeformation. For example, the first read image shown in FIG. 12 isenlarged to the right side of the graph (region side in which value atposition i is large), the second read image shown in FIG. 12 is enlargedto the left side of the graph (region side in which value at position iis small). At the time, the combining section 11 set an enlargementratio of the first read image and an enlargement ratio of the secondread image to the same value (or substantially same value). For thisreason, the first read image and the second read image are correctedsuch that the density values of respective pixels approach each othertoward the binding position Pb. As a result, with the enlargement, boththe first read image and the second read image approach an image such asa broken line in which the density is changed abruptly in the front/rearof the binding position with the binding position as the center as shownin FIG. 12.

FIG. 13 shows an example in a case where the first read image In and thesecond read image I₂₂ shown in FIG. 10 are deformed. FIG. 13 shows anexample that the oblique line portion of the character “N” is deformed,and although an angle of the oblique line changes so as to approach themain scanning direction due to the deformation, the oblique line is astraight line. That is, since the state where the document floats fromthe reference reading position of the document platen occurs due to thebound portion or the like of the book (side opposite to spine cover),the state occurs often locally. Accordingly, the enlargement isperformed often on a part of the document. When a part of the image isenlarged in the main scanning direction, the straight line which isnon-parallel and non-perpendicular in the main scanning direction isextended in the main scanning direction. Therefore, the angle of thestraight line approaches the main scanning direction.

In a case where the enlargement is performed on a part and theenlargement is not performed around the part (both ends in the mainscanning direction), the angle of the straight line is an angle as it isbeing read at the portion that the enlargement is not performed. Forthis reason, an image of a non-straight line in a case where a straightline is read is in a state of including both end portions Pe and thecenter portion Pc having an angle closer to the main scanning directionthan angles of the both end portions shown in FIG. 13. In theembodiment, the straight line which is non-parallel andnon-perpendicular in the main scanning direction as described above arecombined as an image having the both end portions and the centerportion.

Accordingly, it is possible to perform the combining without significantdeterioration of the image quality such as the separation of thestraight line although the straight line which is non-parallel andnon-perpendicular in the main scanning direction such as the obliqueline portion of the character “N” shown in FIG. 13 becomes thenon-straight line. Accordingly, it is possible to improve the imagequality of the scan data in which the outputs of the plurality of linesensors 21 a are combined. Here, there is no need to strictly determinethe direction for non-parallel and non-perpendicular with respect to themain scanning direction. That is, when assuming a situation where atleast one oblique straight line inclined from the main scanningdirection and the sub scanning direction (for example, straight line of45° with respect to both directions) is read as an image of anon-straight line, the effect of the embodiment can be confirmed.

(3) Scan Processing

Next, a procedure of scan processing will be described with reference toa flowchart shown in FIG. 14. When the user places the document on thedocument platen and performs a scan instruction by the operation section80, the controller 10 receives the scan instruction and starts the scanprocessing shown in FIG. 14. When the scan processing is started, thecontroller 10 acquires the binding position and measures the white leveland the black level (step S100).

The binding position may be acquired before scanning of the document,and in the embodiment, acquisition processing of the binding position Pbis performed at an arbitrary timing by the user. When the acquisitionprocessing is started, the controller 10 controls the sub scanningapparatus 41 to move to a reading position of the combining mark andreads the combining mark. The controller 10 records a position of anelement which is the binding position Pb of each line sensor 21 a in amemory from the reading result of the combining mark. Here, it isassumed that the acquisition processing of the binding position Pb isexecuted in advance. In the case, the controller 10 acquires the bindingposition Pb of each line sensor 21 a with reference to the memory instep S100.

Next, the controller 10 measures the black level. That is, thecontroller 10 controls the sub scanning apparatus 41 to move to areading position of the black reference plate B, performs the reading ofthe black reference plate B, and acquires the reading result as theblack level. Next, the controller 10 measures the white level. That is,the controller 10 controls the sub scanning apparatus 41 to move to areading position of the white reference plate W, performs the reading ofthe white reference plate W, and acquires the reading result as thewhite level.

Next, the controller 10 sets the black level and the white level (stepS105). That is, the controller 10 sets the black level and the whitelevel of the element of each line sensor 21 a based on the black leveland the white level measured in step S100. Specifically, the controller10 sets a gain such that intensity between the black level and the whitelevel measured in step S100 can be measured.

Next, the controller 10 read the document (step S110). That is, thecontroller 10 controls the light source 31 to turn on the LED andcontrols the line sensor 21 a and the sub scanning apparatus 41 torepeatedly execute the acquisition of the output of the line sensor 21 aand the movement of the sub scanning apparatus 41. At the time, thecontroller 10 performs a shading correction. That is, each line sensor21 a includes a plurality of elements arranged in the main scanningdirection, and each element (not shown) is connected to an amplificationcircuit. The controller 10 sets a gain of the amplification circuit tothe gain set in step S105 and causes each element to output an analogsignal as a detection result.

When the detection result after the gain acts on each element is output,the analog signal as the output is output subsequently and serially froma scanning circuit (not shown) of each line sensor 21 a. The sensor 21includes the A/D conversion circuit (not shown), the analog signaloutput serially is converted to a digital signal by the A/D conversioncircuit. The converted digital signal is output to the controller 10 ina state associated with the line sensor 21 a which is a reading source.

Next, the combining section 11 performs deviation amount calculationprocessing (step S120). The deviation amount calculation processingcalculates a relative deviation amount in the main scanning directionbetween the first read image and the second read image obtained byreading the same position in the overlap region based on a variation inshading calculated from the first read image and the second read image.

Since the plurality of line sensors 21 a exist in the embodiment, theoverlap region exists in each pair of two adjacent line sensors 21 a.One reading result of the two adjacent line sensors 21 a is the firstread image, and the other reading result is the second read image. Thecalculation of the deviation amount is executed for each of a pluralityof overlap regions generated in one line in the main scanning direction.The details on the deviation amount calculation processing will bedescribed below. Since the step S120 is performed for each lineextending in the main scanning direction each time a document is read,it is possible to dynamically perform the deformation according to thedeviation amount which can be varied depending on a document mode (forexample, presence or absence of bound portion) and a situation (forexample, whether scan includes bound portion).

Next, the combining section 11 performs deformation processing (stepS130). The deformation processing deforms (enlargement in theembodiment) the first read image and the second read image based on thedeviation amount calculated in step S120, and the details will bedescribed below. Needless to say, the deformation processing is executedalso for each of a plurality of overlap regions generated in one line inthe main scanning direction.

Next, the combining section 11 performs mixing processing (step S135).The mixing processing weights and adds the first read image and thesecond read image, and mixes the first read image and the second readimage using the predetermined weighting value (a_(i) and b_(i))described above. Needless to say, the mixing processing is executed alsofor each of a plurality of overlap regions generated in one line in themain scanning direction.

When the mixing processing ends for all lines arranged in the subscanning direction, the acquisition section 12 and the correctionsection 13 execute correction processing (step S140). The correctionprocessing corrects an image after the combining based on the deviationamount calculated in step S120, and the details will be below.

When scan data is generated by the correction processing, the controller10 executes segmentation processing that segments an image having a sizedetermined by a scan setting (step S145) and outputs the obtained scandata (step S150). That is, the controller 10 outputs the scan data tothe computer 90 through the communication section.

(4) Deviation Amount Calculation Processing

Next, a procedure of the deviation amount calculation processing will bedescribed with reference to a flowchart shown in FIG. 15. In theembodiment, the deviation amount is calculated based on a moving amountin a case of moving at least any one of the first read image and thesecond read image in the main scanning direction and the matching degreebetween the first read image and the second read image after themovement. Accordingly, it is impossible to calculate a significantdeviation amount under a situation in which the calculation cannot beexecuted effectively. In the embodiment, in the case where thesignificant deviation amount cannot be calculated, processing isemployed to set the deviation amount to unknown without calculating theamount. For this reason, in the deviation amount calculation processing,processing (steps S200 to S215) is performed to determine whether thesignificant deviation amount can be calculated.

Specifically, the combining section 11 acquires the contrast of theshading of a read image in the overlap region (step S200) and determineswhether the contrast is smaller than a predetermined first thresholdvalue (step S205). In a case where it is determined that the contrast issmaller than the predetermined first threshold value in step S205, thecombining section 11 sets the deviation amount to unknown (step S240).That is, in the case where the contrast of the shading in the overlapregion is small, it is difficult to determine whether the matchingdegree significantly changes in the case of moving the first read imageand the second read image. In the case where the contrast is small, thedeviation amount is set to unknown without calculating the deviationamount.

The contrast may be an index for evaluating whether there is a shadingvariation to an extent that it can be determined whether there is thesignificant change in the matching degree. For example, the contrast canbe calculated by a difference between a maximum value and a minimumvalue of the densities of the first read image and the second read imageincluded in the overlap region or the like. The overlap region may bedetermined in advance. For example, it is possible to employ aconfiguration in which a region having a specific number of pixels inthe front/rear of the binding position Pb is set as the overlap regionor the like. The first threshold value is a predetermined value as athreshold value for eliminating a small contrast to an extent that it isimpossible to calculate the significant deviation amount.

In step S205, in the case where it is not determined that the contrastis smaller than the predetermined first threshold value, the combiningsection 11 acquires a period of the shading of the read image in theoverlap region (step S210) and determines whether the period of theshading is smaller than a predetermined second threshold value (stepS215). In step S215, in a case where it is determined that the period ofthe shading is smaller than the predetermined second threshold value,the combining section 11 sets the deviation amount to unknown (stepS240).

That is, in the case where the period of the shading in the overlapregion is small, a variation in the shading is severe in the first readimage and the second read image, and the first read image and the secondread image frequently match with each other at a plurality of movingamounts in the case of relatively moving the both images in the mainscanning direction. For this reason, it is difficult to calculate whichmoving amount is a true deviation amount in the main scanning directionfor the first read image and the second read image. In the case wherethe period of the shading is short, the deviation amount is set tounknown without calculating the deviation amount.

The period of the shading may be an index for evaluating repetitionfrequency of the change in the density with respect to a position changeof the first read image and the second read image. For example, theperiod can be calculated by a value obtained by adding an absolute valueof the density change between adjacent pixels over the overlap region.In the example shown in FIG. 12, the value can be acquired bycalculating and adding absolute values of (density at positioni+1−density at position i) from i=1 to 10 for both the first read imageand the second read image. The second threshold value is a predeterminedvalue as a threshold value for eliminating a small period to an extentthat it is impossible to specify the significant matching degree.

In step S215, in a case where it is not determined that the period ofthe shading is smaller than the second threshold value, the combiningsection 11 moves the read image of the overlap region in the mainscanning direction (step S220). In the embodiment, processing of movingany one of the first read image and the second read image in apredetermined direction by one pixel is repeated. That is, in theconfiguration in which the displacement of the document from thereference reading position occurs in the floating direction from thedocument platen as in the embodiment, the displacement of the documentmoves the image to the left side of the graph in the first read imageand moves the image to the right side of the graph in the second readimage as shown in FIG. 12.

The combining section 11 moves the read image in a direction opposite tothe movement of the image by the displacement of the document. That is,the combining section 11 sets a moving direction of the first read imageto the right direction of the graph shown in FIG. 12 and sets a movingdirection of the second read image to the left direction of the graphshown in FIG. 12. The combining section 11 moves any one of the firstread image and the second read image by one pixel for one loopprocessing of steps S220 to S230. The combining section 11 alternativelymoves the first read image and the second read image in a repetitionstep of the loop processing. For example, in a case where the movementof the first read image is performed in a certain loop processing, themovement of the second read image is performed in the next loopprocessing. The moving amount of each read image is recorded in thememory.

FIG. 16 shows an example in a case where the first read image moves tothe right side of the graph by one pixel in the initial processing ofthe loop processing in the example shown in FIG. 12. FIG. 17 shows anexample in a case where the first read image moves to the right side ofthe graph by two pixels and the second read image moves to the left sideof the graph by two pixels in the fourth processing of the loopprocessing in the example shown in FIG. 12.

Next, the combining section 11 acquires a difference total value (stepS225). That is, the combining section 11 acquires a difference indensity for each position of the first read image and the second readimage after the movement and acquires a total value. For example, thedifference total value in FIG. 16 is a value corresponding to an area ofregion Z₁₅ interposed between the first read image and the second readimage. In FIG. 17, since the first read image and the second read imagesubstantially match with each other, the difference total value is zerosubstantially.

When the difference total value is acquired, the combining section 11determines whether the processing of a maximum moving amount ends (stepS230) and repeats the processing after step S220 before it is determinedthat the processing of the maximum moving amount ends. The maximummoving amount is a predetermined value as a maximum value of the movingamount of the first read image or the second read image and iscalculated in advance from the maximum value of a possible deviation.

In step S230, in a case where it is determined that the processing ofthe maximum moving amount ends, the combining section 11 acquires amoving amount that minimizes the difference total value as the deviationamount (step S235). That is, the combining section 11 regards that asthe difference total value indicating the difference in the shadingbetween the first read image and the second read image after themovement decreases, the matching degree increases, and acquires themoving amount that minimizes the difference total value as the deviationamount. When the moving amount is acquired as the deviation amount, thecombining section 11 acquires the sum of the moving amount of the firstread image and the moving amount of the second read image as the movingamount, that is, the deviation amount with reference to the memory.

For example, in a case where the difference total value after themovement shown in FIG. 17 is the minimum, four which is the sum of twowhich is the moving amount of the first read image and two which is themoving amount of the second read image is acquired as the deviationamount. Needless to say, various other methods may be employed as themethod of acquiring the deviation amount. For example, the deviationamount may be specified based on the number of executions of the loopprocessing or the like at a stage where the minimum difference totalvalue is calculated. The acquired deviation amount is recorded in thememory in association with the position of the overlap region (the factis recorded even in the case of being unknown in step S240).

In a case where a plurality of the moving amounts that minimize thedifference total value are acquired, one moving amount (for example, onewith small moving amount) is employed. In the case, there is apossibility that the deviation amount is not an integer (for example,deviation amount of 0.5 pixels), but even when such a deviation remains,the influence thereof is reduced effectively by the mixing processing.

In a case where the document does not exist at the reference readingposition due to the floating of the document, since the image is read ina reduced manner as compared with the case of existing at the referencereading position, the pixels at the binding position Pb in the firstread image and the second read image often does not show an image at thesame position. However, since the influence by the floating of thedocument is the movement of the image due to the reduction, when theimage is moved at least in the main scanning direction, it is possibleto generate a state where the reading results at the same positionoverlap (or substantially overlap). When the first read image and thesecond read image after the movement match with each other, there is ahigh possibility that an image at the same position i is a readingresult at the same position. Accordingly, when the matching degree ofthe image after the movement by the loop of steps S220 to S230 isanalyzed, it is possible to specify a deviation degree from an originalreading result and specify the moving amount.

(5) Deformation Processing

Next, a procedure of deformation processing will be described withreference to a flowchart shown in FIG. 18. In the embodiment, thedeformation is performed such that a pixel the first read image and apixel of the second read image indicating the reading result of theoverlap region relatively move by the deviation amount in the mainscanning direction by the deformation. For this purpose, the combiningsection 11 determines whether the deviation amount in an overlap regionto be processed is unknown or zero (step S300) in the deformationprocessing.

That is, since the plurality of the overlap regions are included in oneline extending in the main scanning direction in the embodiment and thedeformation processing is executed for each of the overlap regions asthe processing target, the combining section 11 determines whether thedeviation amount in the overlap region to be processed is set to unknownin step S240. The combining section determines whether the deviationamount in the overlap region to be processed is acquired as zero in stepS235. In step S300, in a case where it is determined that the deviationamount is unknown or zero, the combining section 11 does not set theoverlap region to be processed as a deformation target and skips stepsS305 and S310.

In step S300, in a case where it is not determined that the deviationamount is unknown or zero, the combining section 11 acquires adeformation ratio (step S305). The deformation ratio is processing formoving a reading result of a portion read at the binding position Pb inthe case where the document is not displaced to the binding position Pb.In the embodiment, the deformation is performed from a pixel on thecenter side of the line sensor 21 a toward the binding position Pb sidein each of the first read image and the second read image.

In order to perform the deformation, the combining section 11 determinesa deformation start position located on the center side of the linesensor 21 a from the binding position Pb. The deformation start positionis a position of a pixel which is the starting point of the deformationand a pixel existing at a position moved by a distance exceeding adeviation amount to the center side of the line sensor 21 a from thebinding position Pb. FIGS. 19 and 20 are diagrams for describing thedeformation, FIG. 19 schematically shows the first read image, and FIG.20 schematically shows the second read image. In the figures, it isassumed that the first read image and the second read image are read bya first line sensor 21 a 1 and a second line sensor 21 a 2 equivalent toFIG. 5, and the position of the pixel will be described using a positioni common to both images.

In the figures, density before the deformation of the first read imageis indicated by P_(L1) to P_(L11), and density before the deformation ofthe second read image is indicated by P_(R1) to P_(R11). Further, in thefigures, the binding position Pb is position i=6. Here, it is assumedthat the deviation amount of the first read image in FIG. 19 is 2 andthe deviation amount of the second read image in FIG. 20 is 1. Thedeviation amount of each image is ½ of the relative deviation amount inthe main scanning direction specified in step S235. In a case where ½ ofthe relative deviation amount is a non-integer, for example, it isemployed a configuration in which an incremented value is regarded asthe deviation amount of the first read image, and a lowered value isregarded as the deviation amount of the second read image or the like.

In the example of the first read image shown in FIG. 19, the center sideof the first line sensor 21 a 1 is a region where a pixel in which theposition i is indicated by a value smaller than 1 exists. In the exampleof the second read image shown in FIG. 20, the center side of the secondline sensor 21 a 2 is a region where a pixel in which the position i isindicated by a value larger than 11 exists.

In the examples, the deformation start position is a position moved bydeviation amount+fixed value 2 to the center side from the bindingposition Pb. Accordingly, the deformation start position Ps in FIG. 19is a pixel at position i=2 moved by deviation amount 2+fixed value 2 tothe center side from the binding position Pb, and the deformation startposition Ps in FIG. 20 is a pixel at position i=9 moved by deviationamount 1+fixed value 2 to the center side from the binding position Pb.

When the deformation start position is determined, the combining section11 acquires the deformation ratio as (distance between binding positionPb and deformation start position Ps)/((distance between bindingposition Pb and deformation start position Ps)−deviation amount) foreach of the first read image and the second read image. For example, thedeformation ratio in the example shown in FIG. 19 is 2 (=4/(4−2)), andthe deformation ratio in the example shown in FIG. 20 is 3/2 (=3/(3−1)).

Next, the combining section 11 deforms each of the first read image andthe second read image at each deformation ratio (step S310). That is,the combining section 11 moves a pixel existing on a side opposite tothe center side with the deformation start position as the startingpoint according to a distance from the deformation start position beforethe deformation. Specifically, the combining section 11 moves the pixelhaving density before the deformation to a position distant from thedeformation start position by a value obtained by multiplying thedistance from the deformation start position before the deformation bythe deformation ratio. A pixel exceeding a predetermined range after thedeformation is ignored.

For example, in the example shown in FIG. 19, a pixel (density value PLAexisting at position i=4 before the deformation has a distance of 2 fromthe deformation start position Ps and has a value of 4 multiplied by thedeformation ratio 2 of the first read image. Accordingly, when thedeformation is performed, the pixel existing at position i=4 moves toposition i=6, and density after the deformation of the pixel existing atposition i=6 becomes the density value P_(L4). In the example shown inFIG. 20, a pixel (density value P_(R7)) existing at position i=7 beforethe deformation has a distance of 2 from the deformation start positionPs and has a value of 3 multiplied by the deformation ratio 3/2 of thesecond read image. Accordingly, when the deformation is performed, thepixel existing at position i=7 moves to position i=6, and density afterthe deformation of the pixel existing at position i=6 becomes thedensity value P_(R7). The deformation is executed within thepredetermined range, and in the examples shown in FIGS. 19 and 20, apixel having a position outside the range of positions i=1 to 11 afterthe deformation is ignored.

In the configuration of specifying a moving distance of the pixel basedon the deformation ratio as described above, a pixel in which position iis not the integer by the movement or a pixel which cannot be filled bythe movement of the pixel before the deformation may occur. In the case,density of a pixel in which position i becomes the integer after thedeformation is generated by the interpolation calculation. For example,in the example shown in FIG. 19, the distance from the deformation startposition after the deformation is 1 in a pixel at position i=3 after thedeformation. Accordingly, the distance from the deformation startposition before the deformation is distance from the deformation startposition after the deformation/deformation ratio (1/2). Therefore, adensity value of the pixel at position i=3 after the deformation is adensity value P_(L2.5) of a pixel at position i=2.5.

In the example shown in FIG. 20, the distance from the deformation startposition after the deformation is 2 in a pixel at position i=7 after thedeformation. Accordingly, the distance from the deformation startposition before the deformation is distance from the deformation startposition after the deformation/deformation ratio (2/(3/2)). Therefore, adensity value of the pixel at position i=7 after the deformation is adensity value PR7(2/3) of a pixel at position i=7(2/3). Density of apixel at a position of the non-integer is acquired by the interpolationcalculation (for example, bi-cubic interpolation or bilinearinterpolation) based on the density of a pixel at a position of theinteger. Needless to say, the density calculation of the pixel at theposition of the non-integer may be omitted, and the density of the pixelafter the deformation may be calculated by nearest neighborinterpolation or the like. In particular, in a case of performinghigh-speed scanning (for example, scanning A4 document with a speed of100 ppm or more at 600 dpi), it is desirable to employ an interpolationmethod with a small calculation amount such as bilinear interpolation ornearest neighbor interpolation.

According to the deformation described above, it is possible torelatively move the pixel of the first read image and the pixel of thesecond read image indicating the reading results at the same position ofthe overlap region by the deviation amount in the main scanningdirection by the deformation. For example, in the examples shown inFIGS. 19 and 20, the deviation amount of the first read image is 2, andthe deviation amount of the second read image is 1. For this reason, atthe binding position Pb in the state where the document is notdisplaced, the density of an image to be read in both the first readimage and the second read image is density P_(L4) at position i=4deviated by position 2 from the binding position Pb to the center sidein FIG. 19, and density P_(R7) at position i=7 deviated by position 1from the binding position Pb to the center side in FIG. 20.

In the examples, both the density P_(L4) at position i=4 and the densityP_(R7) at position i=7 move to the binding position Pb by thedeformation, and the sum of both moving amounts is 3. Since the sum ofthe moving amounts matches the value of the relative deviation amountspecified in step S235, the deformation in step S310 is the deformationfor relatively moving the pixel of the first read image and the pixel ofthe second read image indicating the reading results at the sameposition of the overlap region by the deviation amount in the mainscanning direction by the deformation. According to the configuration,it is possible to perform the deformation so as to eliminate or reducethe deviation.

Further, in the embodiment, as the displacement (floating) of thedocument from the reference reading position increases, the deviationamount increases. As the displacement of the document from the referencereading position increases, the size of the document on the imagedecreases. In the embodiment, in a case where the deviation amount islarge, the combining section 11 performs the deformation so as toincrease the deformation ratio of the image in the overlap region in themain scanning direction as compared with a case where the deviationamount is small. For example, since the deviation amount of the firstread image shown in FIG. 19 is larger than the deviation amount of thesecond read image shown in FIG. 20, the deformation ratio of the firstread image is set to a value larger than the deformation ratio of thesecond read image. According to the configuration, it is possible todeform so as to reduce the influence of the displacement of the documentaccording to the deviation amount.

Further, in the embodiment, the combining section 11 does not shift theimage during the deformation, but performs the deformation (enlargement)with the deformation start position as the starting point. Thedeformation is executed in the predetermined range (positions i=1 to 11in FIGS. 19 and 20), and the pixel having a position outside thepredetermined range after the deformation is ignored. Accordingly, aresolution set at the time of scanning is maintained without increasingor decreasing of the number of the pixels with the deformation.

(6) Correction Processing

Next, a procedure of correction processing will be described withreference to a flowchart shown in FIG. 21. When the correctionprocessing is started, the correction section 13 executes gammacorrection and color correction on the scan data combined by theprocessing of the combining section 11 (step S400). The gamma correctionis correction for adjusting the relationship of density with respect toa value of the scan data, and the relationship of density with respectto values of the scan data is corrected based on a predetermined gammacharacteristics. The color correction is correction of color for colormatching and correction for adjusting white balance and can be realizedby various methods.

Next, the acquisition section 12 acquires the deviation amount (stepS405). That is, the acquisition section 12 acquires the deviation amount(deviation amount in the entire overlap region arranged in main scanningdirection and sub scanning direction) recorded in the memory in stepS235 or S240. FIG. 22 is a diagram showing a book as the document, andin FIG. 22, the bound portion (region displaced so as to float fromdocument platen when placed on document platen) of the book is shown bygradation. In the scanner 1, the plurality of the overlap regions existin the main scanning direction, but it is assumed an example that thereare five overlap regions Z_(M1) to Z_(M5) totally for the sake ofsimplicity. Table 1 exemplifies a part of the acquired deviation amountin a case where the document shown in FIG. 22 is read.

TABLE 1 Sub Deviation amount scanning position Z_(M1) Z_(M2) Z_(M3)Z_(M4) Z_(ms) n 0 0 unknown 0 0 n + 1 0 1 unknown 1 1 n + 2 1 1 unknownunknown 1 n + 3 2 2 unknown 2 2 n + 4 unknown 3 unknown 2 2 n + 5 2 2unknown 2 unknown n + 6 3 unknown unknown 3 3 n + 7 unknown unknownunknown unknown unknown n + 8 unknown unknown unknown unknown unknownn + 9 unknown unknown unknown unknown unknown . . . . . .

In the embodiment, in a processing step of the combining section 11,processing of acquiring the deviation amount for all the overlap regionsZ_(M1) to Z_(M5) with respect to all the sub scanning positions isperformed, and the deviation amount is set to unknown or is associatedwith some value. In the table 1, the deviation amount is set to unknownwith respect to all the sub scanning positions in the overlap regionZ_(M3) by reflecting that there is no character on the overlap regionZ_(M3) of the document shown in FIG. 22.

When the deviation amount is acquired, the correction section 13determines a correction target region based on the distribution of thedeviation amount acquired in step S405 (step S410). That is, in theembodiment, since the deviation amount is acquired for each overlapregion, a discrete and local deviation amount in the main scanningdirection is acquired. Even when the degree of the deviation and thedisplacement is observed locally, there is a high possibility that thedeviation and the displacement occur in a wider range in actual usage.

For example, as shown in FIG. 22, since the bound portion of the bookexists over the height direction A (length direction of spine cover) ofthe book, the deviation and the displacement caused by the bound portionexist over the height direction of the book which is the document. whenthe distribution of the deviation amount is specified, it is possible toestimate a region where an equivalent deviation or the displacement ofthe document according to the deviation exists based on thedistribution.

Since the overlap region is a region read by different line sensors 21 ain an overlapped manner, the number of the overlap regions increaseswith the increase of the number of the line sensors 21 a. When threeline sensors 21 a or more are arranged along the main scanningdirection, a plurality of overlap regions are formed in the mainscanning direction. In the case, the plurality of overlap regions existin the main scanning direction and are disposed such that the overlapregions extend in the sub scanning direction. Accordingly, as theoverlap region increase, the number of the overlap regions in the areaof the document increases.

For this reason, according to the embodiment in which the plurality ofoverlap regions exist in the main scanning direction, it is possible toanalyze the degree of the displacement and the deviation amount of thedocument over the wide range of the document. Accordingly, in theconfiguration, when the distribution of the displacement and thedeviation amount of the document in the plurality of overlap regions areanalyzed, it is possible to more accurately analyze the deviation andthe displacement and more accurately determine the correction targetregion.

The distribution may be analyzed by various methods, and the correctionsection 13 estimates a region where the deviation amount equal to orlarger than a threshold value is distributed as the bound portion andacquires the region as the correction target region. However, sincethere is the case where the deviation amount is unknown, in theembodiment, the deviation amount that is unknown is estimated based onthe distribution of the deviation amount. In a case where the deviationamount is specified near the overlap region where the deviation amountis unknown, the estimation is executed by referring the deviationamount. In the embodiment, the deviation amount that is unknown isreplaced by the average value of the deviation amounts specified in theclosest overlap region from the overlap region where the deviationamount is unknown.

For example, in the example shown in table 1, the deviation amount inthe overlap region Z_(M3) at sub scanning position n+1 is unknown, butthe deviation amounts in five overlap regions among eight overlapregions closest to the overlap region Z_(M3) are known. The correctionsection 13 acquires the average value of the five deviation amounts,rounds off, and specifies the deviation amount as 1. The correctionsection 13 subsequently repeats the estimation to acquire the deviationamount in each overlap region. Table 2 exemplifies a deviation amountobtained as a result of performing the estimation based on the deviationamount shown in Table 1.

when the deviation amount is acquired, the correction section 13specifies the region where the deviation amount equal to or larger thanthe threshold value is distributed. In the example shown in Table 2, ina case where the threshold value is 2, a region which is indicated by athick line is specified. The correction section 13 acquires the regionwhere the deviation amount is equal to or larger than the thresholdvalue as the correction target region. As a result, For example, in theexample shown in FIG. 22, a region of a range Zs is acquired as thecorrection target region over the entire region in the main scanningdirection and in the sub scanning direction.

Next, the correction section 13 corrects the brightness and thesharpness of the image in the correction target region based on thedeviation amount. That is, when the reading is performed in the statewhere the document is displaced from the reference reading position,since the document is read on an optical path having an optical pathlength different from the reference optical path length, the degree oflight diffusion changes, and the brightness of the reading result mayvary. When the brightness correction is performed, it is possible toeliminate or reduce the variation of the brightness. On the other hand,an image detected through the optical section 61 may not be focused asexpected due to the change in the optical path length. In the case, thesharpness may be decreased. When the sharpness correction is performed,it is possible to eliminate or reduce the decrease of the sharpness.

In order to perform the brightness correction and the sharpnesscorrection, the correction section 13 acquires a correction coefficientof the brightness (shading) and a correction coefficient (correctioncoefficient of intensity of unsharp mask processing) of the sharpnessbased on the deviation amount (step S415). Specifically, in theembodiment, it is regarded that the brightness decreases in proportionto the deviation amount, a coefficient Km indicating the degree of thedecrease in the brightness per the deviation amount 1 is specified inadvance. It is regarded that the sharpness decreases in proportion tothe increase of the deviation amount, a coefficient Ks for increasingthe intensity of the unsharp mask processing in order to compensate thedecrease in the sharpness per the deviation amount 1 is specified inadvance.

The correction section 13 specifies the correction coefficient of eachpixel based on the coefficient Km, the coefficient Ks, and the deviationamount of each pixel in the correction target region. The deviationamount of each pixel in the correction target region may be specifiedbased on the deviation amount in the overlap region around each pixel.For example, it is possible to employ a configuration in which thedeviation amount of each pixel is specified by the interpolationcalculation or the like based on the deviation amounts of the pluralityof the overlap regions or the like. When the deviation amount of eachpixel is specified, the correction section 13 acquires 1/(1−Km×deviationamount of each pixel) as the correction coefficient of the brightness ofeach pixel. The correction section 13 acquires (1+Ks×deviation amount ofeach pixel) as the correction coefficient of the sharpness of eachpixel.

Next, the correction section 13 corrects the image after the combiningobtained in step S135 based on the correction coefficient (step S420).That is, the correction section 13 performs the correction bymultiplying the density value of each pixel of the image before thecorrection by the correction coefficient 1/(1−Km×deviation amount ofeach pixel) of the brightness. Since the denominator of the correctioncoefficient decreases as the deviation amount of each pixel increases,the correction coefficient increases as the deviation amount of eachpixel increases. For this reason, in the embodiment, the correction isperformed such that a correction amount becomes larger in the case wherethe deviation amount is large than in the case where the deviationamount is small.

The correction section 13 performs processing of increasing thesharpness by the unsharp mask processing. In the embodiment, a referenceprocessing intensity S in the unsharp mask processing is determined inadvance, the unsharp mask processing is performed for each pixel withthe intensity obtained by multiplying the S by the correctioncoefficient (1+Ks×deviation amount of each pixel) of the sharpness.Since the correction coefficient increases as the deviation amount ofeach pixel increases, in the embodiment, the correction is performedsuch that a correction amount of the sharpness becomes larger in thecase where the deviation amount is large than in the case where thedeviation amount is small.

According to the configuration described above, it is possible toperform the correction with the intensity according to the deviationamount for each pixel. The brightness correction is an example, and itsuffices when there is a configuration in which the correction amountbecomes larger in the case where the deviation amount is large than inthe case where the deviation amount is small, that is, a configurationin which the deformation ratio changes continuously or step by stepaccording to the deviation amount. The sharpness correction is anexample, and it suffices when there is a configuration in which thecorrection amount becomes larger in the case where the deviation amountis large than in the case where the deviation amount is small, that is,a configuration in which the deformation ratio changes continuously orstep by step according to the deviation amount.

In the embodiment, the overlap region discretely exists in the mainscanning direction. Accordingly, in the embodiment in which thecorrection section 13 calculates the correction amount of each pixelexisting between the overlap regions from the deviation amount for eachoverlap region and performs the brightness correction and the sharpnesscorrection for each pixel, the same type of correction is performed onthe image in the overlap region and the image in a region continuing tothe overlap region. That is, the overlap region discretely exists on thedocument, but there is a high possibility that the displacement of thedocument continuously occurs exceeding the overlap region. Accordingly,there is a high possibility that the deterioration of the image qualityoccurring in the overlap region continuously occurs even in the regioncontinuing to the overlap region. According to the embodiment in whichthe same type of the correction is performed on the image in the overlapregion and the image in the region continuing to the overlap region, itis possible to effectively eliminate or reduce the deterioration of theimage quality which is occurred continuously.

(7) Example

FIGS. 23 to 25 are diagrams showing examples of scan data obtained byreading a document displaced from the reference reading position. Thedeviation amount is 4 in the examples. The figures are examples of thescan data of the document in which each character of S, N, II (romannumeral 2), III (roman numeral 3),

, and

is arranged in the sub scanning direction (

is a character string that means image in Japanese). FIG. 23 is anexample of the scan data in a case of not performing the deformationprocessing and the mixing processing of the image, FIG. 24 is an exampleof the scan data in a case of not performing the deformation processingand performing the mixing processing of the image, and FIG. 25 is anexample of the scan data in a case of performing the deformationprocessing and the mixing processing of the image.

When the document is displaced from the reference reading position, thedocument is in a state where the reading result is reduced as comparedwith the case where the document exists at the reference readingposition, and the straight line which is non-parallel andnon-perpendicular in the main scanning direction on the overlap regionmay be separated as shown in FIG. 11. For example, as an oblique line ofcharacter N shown in FIG. 23, a straight line which is required tooriginally be one oblique line is viewed as two separated lines. Whenthe displacement amount of the document from the reference readingposition is large, such separation is not eliminated even when themixing processing is performed. Therefore, the two straight lines arenot mixed as shown in FIG. 24.

However, when the image is deformed in the overlap region, although thestraight line which is non-parallel and non-perpendicular in the mainscanning direction on the overlap region becomes the non-straight line,the lines are combined as an image bound into one. For example, theoblique line of character N shown in FIG. 25 is a single line. Theoblique line of character N shows the image having the both end portionsPe and the center portion Pc having the angle closer to the mainscanning direction than angles of the both end portions shown in FIG.13. The change in which the straight line becomes the non-straight lineis observed generally in the straight line which is non-parallel andnon-perpendicular in the main scanning direction on the overlap region.Accordingly, for example, in a case where the scanner 1 reads a straightline that passes from the outside of the overlap region to the outsidethe overlap region through the overlap region, the straight line in theoverlap region has an angle closer to the main scanning direction thanthe straight line outside the overlap region. For this reason, it can besaid that the embodiment includes the configuration of combining thestraight line which is non-parallel and non-perpendicular in the mainscanning direction on the overlap region as the image of thenon-straight line, and further, is the configuration in which the imageof the non-straight line in the case of reading the straight lineincludes the both end portions and the center portion having the anglecloser to the main scanning direction than angles of the both endportions.

Further, in the embodiment, it is possible to perform the combining soas to obtain the same reading result even when the displacement amountfrom the reference reading position of the document is different. Forexample, in the case where the straight line in the overlap region isread, a state is assumed that two elements that detect the straight lineon the overlap region using the line sensor are deviated by one or moreelements from each other due to the different displacement amounts fromthe reference reading position of the document.

That is, when the same document is read twice in the same position wherethe document is placed on the document platen, the same straight line isread by the same element on the line sensor in each case. However, evenwhen the position where the document is placed on the document platen isthe same, when the reading is performed twice in a state where adistance between the document and the reference reading position isdifferent, the same straight line may be read by different elements onthe line sensor. The situation can be said that the reading is performedin a first case where the document including the straight line exists ata position distant from a first distance from the reference readingposition and in a second case where the document including the straightline exists at a position distant from a second distance from thereference reading position, and the straight line is read by elementsdeviated by one or more elements on the line sensor.

As described above, in the case where the same position of the documentis read in the state where the distance from the reference readingposition is different, since the reading is performed in a state where arelative distance between the image at the same position and the bindingposition is different, the deterioration of the image quality such asthe separation of the straight line may occur. Accordingly, when thereis an attempt to make the separated straight line to one only by themixing processing without performing the deformation of the image, awidth of the straight line increases. However, as in the embodiment,when the combining section 11 combines the images in the overlap regionby deforming in the main scanning direction, since the image can bemodified so as to be seen as a single line, there is no need to changethe width of the line by the mixing or the like, and it is possible toperform the combining without the deterioration of the image qualitysuch as increase or decrease of the number of lines. Accordingly, it ispossible to improve the image quality of the scan data obtained bycombining the outputs of the plurality of line sensors 21 a.

FIGS. 25 and 26 are examples of the first case and the second case, andthe deviation amounts are 4 and 3, respectively. For this reason, thereading of the straight line may be performed by the elements deviatedby one or more elements on the line sensor. In the examples, forexample, the oblique lines or the like of the characters “S” and “N” maybe read by the elements deviated by one or more elements on the sameline sensor. In the reading results, the oblique lines or the like ofthe characters “S” and “N” are combined as an image having the samewidth. For example, whether the width is the same may be evaluated bythe number of pixels or the like in a specific direction (main scanningdirection and sub scanning direction). It is possible to employ aconfiguration in which a pixel is regarded as the pixel configuring acharacter in a case where a gradation value of each pixel is equal to orlarger than a predetermined threshold value or the like. There may be aconfiguration that when it is determined whether the width is the same,it is regarded as having the same width in a case where a difference inthe width is equal to or less than a predetermined value.

Further, it can be said the combining section 11 is configured tocombine the straight line as an image of a single line in a case wherethe straight line which is non-parallel and non-perpendicular in themain scanning direction on the overlap region is read as an image havinga width of two pixels in the main scanning direction by relativelychanging the reading results of the first region and the second regionby at least four pixels in the main scanning direction.

That is, the state (state where deviation amount is 4) where the degreeof relative deviation in the main scanning direction between the firstread image and the second read image that read the same position in theoverlap region is 4 pixels is an extremely large deviation in thereading of the straight line having the width of two pixels in the mainscanning direction. For example, in the examples in FIGS. 23, 24, and25, the oblique lines of the characters “S” and “N” correspond to thelines having the width of two pixels in the main scanning direction(width becomes 2 after binarization by threshold value). In the case ofperforming the reading of the straight line in the state, when thecombining is performed without performing the deformation and mixing inthe embodiment, for example, the straight lines obviously becomediscontinuous as shown in FIG. 23. When such large deviation occurs, thelines often do not become one even in the case of performing the mixingprocessing (shadowy image may appear) as shown in FIG. 24.

However, when the deformation in the embodiment is performed, even whena large deviation occurs from the line width, it can be combined as asingle line having the width of two pixels in the main scanningdirection as shown in FIG. 25. As a result, it is possible to performthe combining without the deterioration of the image quality such as thediscontinuity of the straight line. Accordingly, it is possible toimprove the image quality of the scan data obtained by combining theoutputs of the plurality of line sensors. The image of the single linewhich is a combining result of the straight line may be an image whichis not discontinuous due to the separation of the line or the like andis recognized as a single line or an image of non-straight line such asa polygonal line or a curved line.

Further, the combining section 11 combines the straight line as an imageof a single line in a case where the straight line which isperpendicular in the main scanning direction on the overlap region isread as an image having a width of two pixels in the main scanningdirection by relatively changing the reading results of the first regionand the second region by at least four pixels in the main scanningdirection.

That is, the state (state where deviation amount is 4) where the degreeof relative deviation in the main scanning direction between the firstread image and the second read image that read the same position in theoverlap region is 4 pixels is an extremely large deviation in thereading of the straight line having the width of two pixels in the mainscanning direction. For example, in the examples in FIGS. 23, 24, and25, the middle vertical lines (line parallel to sub scanning direction)in the characters “III (roman numeral 3)” and “

” correspond to the lines having the width of two pixels perpendicularto the main scanning direction (width becomes 2 after binarization bythreshold value). In the case of performing the reading of the straightline in the state, when the combining is performed without performingthe deformation and mixing in the embodiment, for example, the straightline is viewed obviously as two separated lines as shown in FIG. 23.When such large deviation occurs, the lines often remain separated evenin the case of performing the mixing processing as shown in FIG. 24.

However, when the deformation in the embodiment is performed, even whena large deviation occurs from the line width, it can be combined as asingle line having the width of two pixels in the main scanningdirection as shown in FIG. 25. As a result, it is possible to performthe combining without the deterioration of the image quality such as theseparation of the straight line. Accordingly, it is possible to improvethe image quality of the scan data obtained by combining the outputs ofthe plurality of line sensors. The image of the single line which is acombining result of the straight line may be an image which is notdiscontinuous due to the separation of the line or the like and isrecognized as a single line or an image of non-straight line such as apolygonal line or a curved line.

(8) Another Embodiment

The embodiment described above is an example for performing theinvention, and various other embodiments can be employed. For example,the scanner according to one embodiment of the invention may be includedin a composite machine or the like which is an electronic component usedfor a purpose other than the reading.

Further, as in the embodiment, the method of generating the scan data bycombining the first scan data output from the first line sensor 21 a 1and the second scan data output from the second line sensor 21 a 2 canbe realized as an invention of a program, an invention of a method, andan invention of a generation method of scan data.

Further, the scan data generated by performing the reading may be outputto a storage medium such as a USB memory mounted on the apparatus tostore the scan data, may be output to a print mechanism to print (thatis, copy) the scan data, or may be output to a monitor to display inaddition to output to the computer 90. Further, the processing in atleast a part of the combining section 11, the acquisition section 12,and the correction section 13 may be performed by a driver program or anapplication program of the computer 90, and final scan data may begenerated by the combining. In the case, it is possible to regard thecomputer 90 as a part of the scanner.

The first region, the second region, and the overlap region describedabove are regions on the document and are defined by a relationshipbetween the line sensor 21 a included in the scanner 1 and the documentset to the scanner 1. That is, in the scanner 1, a position and anoptical system (for example, optical section such as lens and lightsource) of the line sensor 21 a are designed so as to read the sameposition by the plurality of line sensors 21 a in an overlapped manner.In such configuration, when the document is read by the first linesensor 21 a 1 and the second line sensor 21 a 2, a region where thedocument exists is read by both the first line sensor 21 a 1 and thesecond line sensor 21 a 2. The region is the overlap region. The scanner1 may include at least two line sensors 21 a, and the number of the linesensors is not limited as long as the scanner includes the plurality ofline sensors. Accordingly, the number of the line sensors may be threeor more. In the case, there are a plurality of the first region and thesecond region.

The scanner 1 may scan the document in various modes, and variousconfigurations can be employed such as a configuration of scanning thedocument while transporting with auto document feeder (ADF) or aconfiguration of scanning while moving an optical unit of the linesensor 21 a or the like with respect to the document placed on thedocument platen. The scanner 1 is not limited to the one that performsthe scanning by switching between a monochrome line sensor and lightsources of a plurality of colors. The scanner may be a monochromescanner that performs the scanning by the monochrome line sensor and alight source of single color or may be a color scanner that includes aplurality of sensor arrays in which each of the plurality of linesensors 21 a corresponds to each of the plurality of colors and performsthe scanning using a white light source.

In the scanner including the document platen, a displacement directionof the document from the reference reading position is one direction ofa floating direction. However, in the scanner including theconfiguration of transporting the document with ADF, there is a casewhere the displacement direction of the document from the referencereading position is defined by two directions (floating direction orsinking direction). In the case, the optical path length reaching to thedocument and the line sensor from the light source may be varied inpositive and negative with respect to the reference optical path length.Accordingly, in the case where the displacement of the document occurs,a case where the image is read in a reduced state and a case where theimage is read in an enlarged state may occur.

In the case where the image is enlarged, the difference total value canbe minimized by moving the first read image and the second read imageaway from each other in step S220 described above. Accordingly, in thecase where the displacement of the document is two directions, in theloop processing in steps S220 to S230, the difference total value isacquired by trying to move the first read image and the second readimage toward and away from each other. In step S235, the deviationamount is acquired by setting a deviation amount acquired by any one ofsuch moving directions as positive and a deviation amount acquired bymoving in the opposite direction as negative.

In the embodiment described above, the non-straight line in which thestraight lines are read and combined may be a line in which theorientation of a continuous line is not in one direction. Accordingly,the non-linear line may be a figure having a bending point at least oneplace of the continuous line, may be a curved line, or may be acombination thereof. That is, in the embodiment described above, even inthe state where the document is displaced from the reference readingposition, since the straight line existing in the overlap region isdeformed, an angle of the line may be an angle different from thestraight line on the document. However, when the change in the angle ispermitted, it is possible to read the line as a single line withoutseparating lines.

The straight line existing in the overlap region is a straight line onthe document and may be a figure which is required to be read as astraight line unless the position of the document is displaced.Accordingly, even when the document itself is scanned in a bent statesuch as the bound portion of the book, when a figure that becomes astraight line when the document is flat is inclined in the main scanningdirection and the sub scanning direction, the figure may correspond tothe straight line which is non-parallel and non-perpendicular in themain scanning direction on the overlap region.

Further, in a configuration in which the straight line is combined asthe non-straight line having the center portion and the both endportions, the center portion may have an angle closer to the mainscanning direction than the both end portions (state where anintersecting angle of an acute angle with respect to the main scanningdirection is smaller in the center portion than in the both endportions). That is, in the case where the enlargement of the image isperformed in the main scanning direction by the combining section 11,since the line which is non-parallel and non-perpendicular in the mainscanning direction is deformed so as to have the angle close to the mainscanning direction, the center portion may be a line having an anglereflecting the deformation. The both end portions are lines located atboth ends of the line having the angle and portions which are notsubjected to the deformation such as the enlargement or are lessaffected by the deformation. Accordingly, the center portion is mainlythe reading result of the figure on the overlap region, and the both endportions are mainly the reading result of the figure outside the overlapregion (or figure in a region which is not deformed).

The reference reading position may be an appropriate position of thedocument, and various determination methods can be employed according tothe mode of the scanner 1. For example, in the case of the scanner 1that scans the document while transporting with auto document feeder(ADF), for example, a specific position in the document transportationpath is the reference reading position, and in the case of the scanner 1that scans the document placed on the document platen, for example, acontacting position between the document platen and the document in thestate where the document is placed on the document platen is thereference reading position.

The deviation amount may be acquired based on the matching degreebetween the first read image and the second read image, and the matchingdegree may be defined for specifying a deviation degree between thefirst read image and the second read image that read the same positionfrom an original position. Accordingly, the matching degree may beverified for a range where the reading result at the same position canbe included in the first read image and the second read image. Forexample, a range of a pixel that reads the overlap region is determinedin advance, the first read image and the second read image are moved inthe range, and the matching degree may be verified. Since the first readimage and the second read image are similar, the matching degree may bedefined so as to be a high matching degree.

Further, the shading of the image which is analyzed when specifying thedeviation amount may be a value reflecting a detection value of the linesensor, and various configurations can be employed such as an outputvalue from a line sensor element, a value after image processing such asgamma correction or the like, a gradation value for each colorcomponent, or a value such as the brightness.

Further, in the embodiment described above, the deformation ratio ischanged linearly according to the deviation amount, but there may be aconfiguration in which the deformation ratio is larger in the case wherethe deviation amount is large than in the case where the deviationamount is small. That is, there may be a configuration in which thedeformation ratio is changed continuously or step by step according tothe deviation amount.

Further, in the embodiment described above, the correction section 13executes the brightness correction and the sharpness correction based onthe deviation amount (relative deviation amount of first read image andsecond read image in the main scanning direction), but otherconfigurations may be employed. For example, there may be aconfiguration in which the acquisition section 12 acquires a degree ofthe displacement of the document from the reference reading position,and the correction section 13 corrects the image after the combiningbased on the degree of the displacement.

That is, when the degree of the displacement of the document from thereference reading position is acquired directly, it is possible toperform the correction for eliminating or reducing the deterioration ofthe image quality caused by the displacement of the document from thereference reading position. For example, it is possible to employ aconfiguration in which the deviation is measured by a sensor (forexample, distance sensor) included in the scanner 1. The degree of thedisplacement may be acquired as the displacement amount from thereference reading position, and, for example, another configuration inwhich the degree of the displacement is acquired relatively in twostates where displacement states are different or the like may beemployed.

Further, as the correction method by the correction section 13, variousmethods other than the method described above can be employed. Forexample, a configuration may be employed in which the correction section13 corrects the image inside the correction target region based on theimage outside the correction target region. That is, the deteriorationof the image quality such as decrease in the brightness and decrease inthe sharpness caused by the displacement of the document can occur inthe correction target region, but in the outside thereof, it isestimated that the deterioration of the image quality caused by thedisplacement of the document does not occur. When the image outside thecorrection target region is analyzed, it is possible to specify thecorrection for eliminating or reducing the deterioration of the imagequality in the correction target region. For example, it is possible toeliminate or reduce the deterioration of the image quality by correctingthe image in the correction target region so as to approach thebrightness and the sharpness outside the correction target region.

For example, the configuration is realized as a configuration ofcorrecting the inside of the correction target region based on abackground color around the inside of the correction target region. Morespecifically, a coefficient Kmax is defined in advance as a coefficientfor correcting the maximum decrease in the brightness by the deviationamount 1. The correction section 13 acquires a temporary density valueof each pixel by multiplying the density value of each pixel by acorrection coefficient 1/(1−Kmax×deviation amount of each pixel). In acase where the temporary density value is brighter than the backgroundcolor of the document, the pixel color is set to the background color,and in a case where the temporary density value is darker than thebackground color of the document, the pixel color is regarded as thetemporary density value.

What is claimed is:
 1. A scanner that combines images read by a firstsensor array and a second sensor array, wherein the first sensor arrayand the second sensor array have read regions which are overlappedpartially, and the scanner comprises: a processor that combines andoutputs a straight line as an image in which a non-straight line isdrawn in a case where a document in which the straight line which isnon-parallel and non-perpendicular in a main scanning direction is drawnis read by the first sensor array and the second sensor array at apredetermined position.
 2. The scanner according to claim 1, wherein theprocessor combines and outputs an image in which a line is drawn inwhich a partial region of the straight line on the document has an anglecloser to the main scanning direction than the straight line on thedocument.
 3. The scanner according to claim 1, wherein the processorcombines and outputs the straight line as an image in which a singleline is drawn in a case where the document is located in a directionperpendicular to the document from the predetermined position by a sizethat reading results of the first sensor array and the second sensorarray are deviated by at least four pixels in the main scanningdirection, and in a case where the straight line which is non-paralleland non-perpendicular in the main scanning direction is read by thefirst sensor array and the second sensor array as an image having awidth of two pixels in the main scanning direction.
 4. The scanneraccording to claim 1, wherein the processor combines and outputs thestraight line as an image in which a single line is drawn in a casewhere the document is floated in a direction perpendicular to thedocument by a size that reading results of the first sensor array andthe second sensor array are deviated by at least four pixels in the mainscanning direction and in a case where a straight line perpendicular tothe main scanning direction is read as an image having a width of twopixels in the main scanning direction.
 5. A non-volatile storage mediumthat stores a scan program, the program causing a computer that controlsa scanner for combining images read by a first sensor array and a secondsensor array and a scanner in which read regions are overlappedpartially in the first sensor array and the second sensor array torealize a function of: combining and outputting a straight line as animage in which a non-straight line is drawn in a case where a documentin which the straight line which is non-parallel and non-perpendicularin a main scanning direction is drawn is read in an overlapped manner bythe first sensor array and the second sensor array at a predeterminedposition.
 6. A method of producing scan data using a scanner forcombining images read by a first sensor array and a second sensor arrayand a scanner in which read regions are overlapped partially in thefirst sensor array and the second sensor array, the method comprising:combining and outputting a straight line as an image in which anon-straight line is drawn in a case where a document in which thestraight line which is non-parallel and non-perpendicular in a mainscanning direction is drawn is read in an overlapped manner by the firstsensor array and the second sensor array at a predetermined position.